﻿using System;

namespace Aeon.Configuration
{
    /// <summary>
    /// Specifies a range of valid values on a property or field.
    /// </summary>
    [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)]
    public sealed class RangeConstraintAttribute : Attribute
    {
        /// <summary>
        /// Initializes a new instance of the RangeConstraintAttribute class.
        /// </summary>
        /// <param name="minimum">The minimum value of the property or field.</param>
        /// <param name="maximum">The maximum value of the property or field.</param>
        public RangeConstraintAttribute(int minimum, int maximum)
        {
            this.MinimumValue = minimum;
            this.MaximumValue = maximum;
        }

        /// <summary>
        /// Gets the minimum value of the property or field.
        /// </summary>
        public int MinimumValue { get; private set; }
        /// <summary>
        /// Gets the maximum value of the property or field.
        /// </summary>
        public int MaximumValue { get; private set; }
    }
}
